package com.akuma.redmine.exception;

import org.slf4j.helpers.MessageFormatter;

/**
 * Created by akuma on 2016/6/30.
 *
 * @author akuma
 */
public class RedMineException extends RuntimeException {
    public RedMineException() {
        super();
    }

    public RedMineException(String message) {
        super(message);
    }

    public RedMineException(String message, Throwable cause) {
        super(message, cause);
    }

    public RedMineException(Throwable cause) {
        super(cause);
    }

    protected RedMineException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public static void throwException() {
        throw new RedMineException();
    }

    public static void throwException(String message) {
        throw new RedMineException(message);
    }

    public static void throwException(Throwable cause) {
        throw new RedMineException(cause);
    }

    public static void throwException(String message, Throwable cause) {
        throw new RedMineException(message, cause);
    }

    public static void throwException(String message, Object... objects) {
        throwException(MessageFormatter.arrayFormat(message, objects).getMessage());
    }
}
